/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.park.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 班次设置
 *
 * @author pig
 * @date 2024-01-22 15:12:38
 */
@Data
@TableName("base_shift_work")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "班次设置")
public class BaseShiftWorkEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 排版方式
     */
    @Schema(description = "排版方式")
    private String shiftMode;

    /**
     * 当班人数
     */
    @Schema(description = "当班人数")
    private String shiftWorkNum;

    /**
     * 公休日值班方式
     */
    @Schema(description = "公休日值班方式")
    private String shiftHolidayMode;

    /**
     * 值班人数
     */
    @Schema(description = "值班人数")
    private Integer shiftPersonNum;

    /**
     * 班次状态
     */
    @Schema(description = "班次状态")
    private String shiftStatus;

    /**
     * 班次
     */
    @Schema(description = "班次")
    private String shiftName;

    /**
     * 工作开始时间
     */
    @Schema(description = "工作开始时间")
    @JsonFormat(pattern = "HH:mm:ss")
    private Date workStart;

    /**
     * 工作结束时间
     */
    @Schema(description = "工作结束时间")
    @JsonFormat(pattern = "HH:mm:ss")
    private Date workEnd;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;


    public String getShiftStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.shift_status, this.shiftStatus);

    }

    public String getShiftModeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.shift_work_mode, this.shiftMode);

    }

    public String getShiftHolidayModeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.shift_work_mode, this.shiftHolidayMode);

    }

}
